<!DOCTYPE html>
<html lang="zh-CN">  
<head>
    <meta charset="UTF-8">
    <title>Test-wj</title>
    <link rel="stylesheet" href="/static/css/test.css" />
    <script type="text/javascript" src="/static/js/jquery-3.2.1.js"></script>
    <script type="text/javascript" src="/static/js/jquery-3.2.1.min.js"></script>
    
</head>
<body>
    <div class="test1">
        <form id="form1" action="http://localhost:5000/num" method="post">
            <label for="num1">输入的数字1:</label><br>
            <input type="text" id="input1" placeholder="请输入数字"><br>
            <label for="num2">输入的数字2:</label><br>
            <input type="text" id="input2" placeholder="请输入数字"><br>
            <input type="button" id="btnsubmit" value="提交"><br>
        </form>
    </div>  
    <script>
        $("#btnsubmit").click(function(){
            var input1 = $("#input1").val()
            var input2 = $("#input2").val()
            $.ajax({
                url: "/num",
                type: "POST",
                data: {
                    "input1": input1,
                    "input2": input2,
                },
                contentType: 'application/json',
                dataType: 'json', 
                success:function(data){
                    alert(res);
                },
                error:function(){
                    alert("提交失败");
                }, 
            });
        })        
        
    </script>
    <span>{{ name }}</span>
    <table id="result">
        <tr>
            <th>公司名称</th>
            <th>城市</th>
        </tr>
        <h3>{{ compara_name|length }}家公司的供应列表</h3>
        {% for compare in compara_name %}
        <tr>    
            <td><a href='{{ url_for("compare", name=compare.name)}}'>{{compare.name}}</a></td>
            <td>{{ compare["city"]}}</td>
        </tr>
        {% endfor %}
    </table>
</body>
</html>